<template>
  <el-dialog
    v-el-drag-dialog
    title="优惠金额"
    :visible.sync="visible"
    width="600px"
    @close="reset"
  >
    <lb-table
      ref="lbTable"
      border
      highlight-current-row
      element-loading-text="加载中"
      :column="tableData.column"
      :data="tableData.data"
      show-summary
      @fetch="fetchData"
    />
  </el-dialog>
</template>

<script>

  export default {
    name: 'species-amount',
    data() {
      return {
        visible: false,
        tableData: {
          total: 0,
          column: [
            {
              prop: 'payMethod',
              label: '优惠项'
            },
            {
              prop: 'amount',
              label: '金额'
            }
          ],
          data: [{
            payMethod: 1,
            amount: 500
          }]
        }
      }
    },
    methods: {
      async open(temp) {
        return new Promise(resolve => {
          this.resolve = resolve
          this.visible = true
        })
      },
      _getQuery(obj) {
        const query = {}
        for (const key in obj) {
          if (obj.hasOwnProperty(key)) {
            if (obj[key] !== '') {
              query[key] = obj[key]
            }
          }
        }
        return query
      },
      async fetchData() {
        // const query = {
        //   ...this._getQuery(this.query)
        // }
        // if (this.date && this.date.length === 2) {
        //   query[this.dateType] = this.date[0].format()
        //   query[`${this.dateType}End`] = this.date[1].format()
        // }
        // const res = await queryOrderManageList(query)
        // this.tableData.data = res.data
      },
      reset() {

      }
    }
  }
</script>

<style scoped>

</style>
